<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #bt1{
            background-color: green;
            height: 300px;
        }
        #bt2{
            background-color: pink;
            height: 200px;
        }
        #bt3{
            background-color: orange;
            height: 100px;
        }
    </style>
</head>
<body>
    <div id="bt1">
        <div id="bt2">
            <div id="bt3"></div>
        </div>
    </div>
</body>
<script>
    var bt3=document.querySelector('#bt3');
    var bt2=document.querySelector('#bt2');
    var bt1=document.querySelector('#bt1');
    bt3.onclick=function(event){
        if(event.target==event.currentTarget){
            console.log(3)
        }
    }
    bt2.onclick=function(event){
        if(event.target==event.currentTarget){
            console.log(2)
        }
    }
    bt1.onclick=function(event){
        if(event.target==event.currentTarget){
            console.log(1)
        }
    }
</script>
</html>